<%- include header.ejs %>
<div >
    <div style="margin-left: 10%;margin-right: 10%;min-height: 300px">
        <div style="background-color: white;height: 50px">
            <div style="height: 50px;background-color: #8c0f13;width: 100px;text-align:center;margin-left: 50px;color: white;font-size: 18px;line-height: 50px">课件超市</div>
        </div>
        <div style="margin-top: 30px;padding-left: 50px">
        <% results.forEach(function(data, index){ %>



            <div style="float:left;font-family: '微软雅黑';font-size: 15px;padding-top:5px;margin-bottom:15px;">
                <span style="font-size: 14px">
                    <b style="color:#d11519 ">· &nbsp;&nbsp;</b><b>

                        <%if(['mp4','flv'].in_array(data.Courseware_Name.split('.')[1].trim())){%>
                        <a href="/player?addr=<%=data.Courseware_Path.split('~')[1]?data.Courseware_Path.split('~')[1]:data.Courseware_Path.split('~')[0]%>" target="_blank"><%= data.Courseware_Name.split('.')[0] %></a>
                        <%}else{%>
                        <a href="<%=url+(data.Courseware_Path.split('~')[1]?data.Courseware_Path.split('~')[1]:data.Courseware_Path.split('~')[0])%>"><%= data.Courseware_Name.split('.')[0] %></a>
                        <%}%>
                        &nbsp;&nbsp;&nbsp;&nbsp;<%= data. Courseware_DateTime.split(' ')[0]%></b>
                </span>
            </div>
            <div style="float: right;margin-right: 50px"><b><%=data.CoursewareSort_Name%></b></div>

            <div style="clear: both"></div>
            <% }) %>
        </div>
        <div style="text-align: center;margin-top: 50px">
            <%if(page.totalPage!=0&&page.curPage<=page.totalPage){%>
               <b  style="margin-left: 20%;font-size: 13px;float:left;border-radius: 20px;border: solid <%if(page.curPage==1){%>#979797<%}else{%>#c8656f<%}%> 2px;width: 100px;padding: 2px"><a style="cursor: pointer;color:<%if(page.curPage==1){%>#979797"<%}else{%>#c8656f" onclick="forPage(-1)"<%}%>><上一页</a></b>
               <b  style="margin-left:40%;font-size: 13px;float:left;border-radius: 20px;border: solid <%if(page.curPage!=page.totalPage){%>#c8656f<%}else{%>#979797<%}%> 2px;width: 100px;padding: 2px"><a style="cursor: pointer;color:<%if(page.curPage!=page.totalPage){%>#c8656f" onclick="forPage(1)"<%}else{%>#979797"<%}%>>下一页></a></b>
            <%}else{%>
                <span style="font-size: 20px">没有找到相关数据</span>
            <%}%>
        </div>

    </div>
</div>


<%- include footer.ejs %>
<script>
    function forPage(num){
        var curPage=<%=page.curPage%>;
        var totalPage=<%=page.totalPage%>
        window.location.href=window.location.href.split('?')[0]+'?page='+(curPage+num)

    }
</script>